FROM ubuntu

# 签名
MAINTAINER diamond "458293193@qq.com"

RUN apt-get update
RUN apt-get install openjdk-7-jdk -y
RUN apt-get install git -y
RUN apt-get install zip -y

ADD ./soft /tmp
#安装tomcat 给catalina.sh加上可执行权限
RUN unzip /tmp/apache-tomcat-7.0.64.zip && mv ./apache-tomcat-7.0.64/ /usr/local/tomcat
ENV TOMCAT_HOME /usr/local/tomcat
RUN chmod +x /usr/local/tomcat/bin/catalina.sh

#安装maven
RUN tar xvf /tmp/apache-maven-3.2.5-bin.tar.gz && mv ./apache-maven-3.2.5 /usr/local/maven3
ENV MAVEN_HOME /usr/local/maven3

RUN git clone https://git.oschina.net/diamond/GeneralAuthorizationSystem.git
RUN cd ./GeneralAuthorizationSystem && ls -l && $MAVEN_HOME/bin/mvn clean package &&  mv target/gas.war $TOMCAT_HOME/webapps/gas.war

CMD /usr/local/tomcat/bin/catalina.sh start && tail -F /usr/local/tomcat/logs/catalina.out
EXPOSE 80 8080